/**
 * @file uuid生成
 */
import { v5 } from 'uuid'

/**
 * 生成uuid随机字符串
 * @param {*} [name]
 * @param {*} [namespace]
 * @returns {string} uuid
 */
export const uuid = (name = Date.now() + '' + Math.random(), namespace = Math.random()) => {
  namespace = v5(namespace.toString(), v5.URL)
  const str = v5(name, namespace)
  return str
}
